import wepy from 'wepy'
const baseUrl = 'https://www.zhengzhicheng.cn/api/public/v1'
wepy.baseToast = function(str = '获取数据失败') {
  wepy.showToast({
    title: str,
    icon: 'none'
  })
}
wepy.getData = function(url, data = {}) {
  return wepy.request({
    url: baseUrl + url,
    header: {
      'Content-Type': 'application/json;charset=UTF-8;'
    },
    method: 'GET',
    data
  })
}
wepy.postData = function(url, data = {}) {
  return wepy.request({
    url: baseUrl + url,
    method: 'POST',
    data
  })
}
